{{include file="header_inc.html"}}
<style type="text/css">
.line_ff9966,.line_ff9966:hover td {
	background-color: #FF9966
}

.line_fbffe4,.line_fbffe4:hover td {
	background-color: #fbffe4
}

.list-dot-othors li {
	float: none;
	width: auto
}
</style>

<body>
	<form action="/content/manage/categorylist/" method="post"
		name="myform" id="myform">
		<input type='hidden' name='catid' value="" id="relation"> <input
			type='hidden' name='id' value="{{$id}}" id="id">
		<div class="pad-10">
			<div class="col-tab">
				<ul class="tabBut cu-li">
					<li><a href="/content/manage/push/id/{{$id}}/">推送到推荐位</a></li>
					<li class="on"><a
						href="/content/manage/categorylist/id/{{$id}}/">推送到其他栏目</a></li>
				</ul>
			</div>
			<div
				style="width: 400px; padding: 2px; border: 1px solid #d8d8d8; float: left; margin-top: 10px; margin-right: 10px">
				<table width="100%" cellspacing="0" class="table-list">
					<thead>
						<tr>
							<th width="100">栏目ID</th>
							<th>栏目名称</th>
						</tr>
					</thead>
					<tbody id="load_catgory">
						{{foreach item=content from=$categorys}}
						<tr title="点击选择" class="cu"
							onclick="select_list(this,'{{$content.catname}}',{{$content.id}})">
							<td align="center">{{$content.id}}</td>
							<td style="">{{$content.catname}}</td>
						</tr>
						{{/foreach}}
					</tbody>
				</table>
			</div>

			<div
				style="overflow: hidden; _float: left; margin-top: 10px; *margin-top: 0; _margin-top: 0">
				<fieldset>
					<legend>已选栏目</legend>
					<ul class='list-dot-othors' id='catname'>
					</ul>
				</fieldset>
			</div>
			<div
				style="overflow: hidden; _float: left; margin-top: 10px; *margin-top: 0; _margin-top: 0">
				<fieldset>
					<legend>推送新闻</legend>
					<ul class='list-dot-othors' id='news'>
						{{foreach item=content from=$News_list}}
						<li>·<span>{{$content.title}}</span></li> {{/foreach}}
					</ul>
				</fieldset>
			</div>
		</div>
		<div class="bk15"></div>
		<input type="submit" class="dialog" id="dosubmit" name="dosubmit"
			value="提交" />
	</form>
</body>
<SCRIPT>	
function select_list(obj, title, id) {
		var relation_ids = $('#relation').val();
		var sid = 'v' + id;
		$(obj).attr('class', 'line_fbffe4');
		var str = "<li id='"+sid+"'>·<span>"
				+ title
				+ "</span><a href='javascript:;' class='close' onclick=\"remove_id('"
				+ sid + "')\"></a></li>";
		$('#catname').append(str);
		if (relation_ids == '') {
			$('#relation').val(id);
		} else {
			relation_ids = relation_ids + ',' + id;
			$('#relation').val(relation_ids);
		}
	}

	//移除ID
	function remove_id(id) {
		$('#' + id).remove();
	}
</SCRIPT>
{{include file="footer.html"}}
